<template>
  <el-button v-if="show" @click="toggle" text>
    <el-icon style="font-size: 18px">
      <icon/>
    </el-icon>
  </el-button>
</template>
<script setup>
import {Fold, Expand} from '@element-plus/icons-vue';
import {computed, shallowRef} from 'vue';
import store from '@/store';

const icon = computed(() => store.state.menuCollapse ? Expand : Fold);
const show = computed(() => store.state.globalLayout === 'normal')
function toggle() {
  store.state.menuCollapse = !store.state.menuCollapse
}
defineOptions({name: 'PortalHeaderCollapseButton'});
</script>
<style scoped lang="scss">

</style>